Skip to content

Device apps (portal): every app drawn from what the API says — no console UI, no console detection - #1336

Closed
evanrbowers wants to merge 1 commit into
solofrom
solo-apps-generic
Closed

evanrbowers wants to merge 1 commit into
solofrom
solo-apps-generic

Conversation

@evanrbowers

Copy link
Copy Markdown
Contributor

The portal side of step 2/3 of presence-contract docs/self-contained-apps.md: every app is drawn from what the API says of it — no component and no detection per app.

Depends on the graphql PR adding DeviceApp.protocol, capabilities, hostKey, sessions { id login person via since }, sessionsOpen and CatalogApp/CatalogAppRelease .capabilities/.protocol. An older graphql refuses these queries, so graphql ships first. (DeviceProductApp.capabilities/protocol are asked only where the schema has them.)

What was replaced

Before Now
firstPartyApps.ts FIRST_PARTY_APPS = {console}, ConsoleApp.tsx (icon, state words, ai_commands label/help, host key via sshHostKey, Open terminal) The generic view (DeviceApps.tsx, DeviceAppPage.tsx): icon from protocol; state in the shared words; settings in the release's labels/help; Host key … from DeviceApp.hostKey; Sessions (count; who/as whom/by an AI/since, for managers); Open terminal for any app whose protocol is ssh and that declares person-certificates (AppTerminalAction)
sshHelper.isConsoleService (type 28 + host remoteit-console) in ServiceConnectButton, LocalSubnetConnect, BrowserGatewayConnect, DevicePage, ConsoleTerminal sshHelper.opensTerminal(app) + appsHelper.serviceApp(apps, service): the app naming the service (DeviceApp.serviceId), or, while disabled, the one at its app host (remoteit-app-<publisher>-<app>). useServiceApp reads a device's apps only for a service at an app host. ConsoleTerminal.tsx becomes AppTerminal.tsx (row button, connect-panel option, Apps action), titled by the app's name
graphQLSshHostKey DeviceApp.hostKey (the terminal itself still checks sshHostKey, as before)
useDeviceApps().console, CONSOLE gone; useDeviceApps(id, { offers: false }) skips the catalogue read for parts that add nothing
thisDevice/shared.tsx SETTING_TITLES['remoteit.console'], UNDER_SERVICES console entry, OPTIONS appSettings(listed, apps): titles from the API (device read by its UID), any <app>.<name> under its app's row, "Not served" for an app that serves a service. Device-level settings (any_port, etc.) unchanged
— Capabilities in words beside Runs as root in the catalogue, device catalogue (from the account's catalogue entry; AvailableApp has none), app page, each release, product apps; and in every root consent (device, product, Add dialog; a restricted app says them above Add): "Keeps accounts for the people you share with", "Signs in people by remote.it certificate", "AI commands go through this app"

SCREENVIEW stays, used only for ScreenView's old-install migration.

Temporary console fallback

frontend/src/services/consoleUntilDeclared.ts is the only place the portal names the console. Until the console declares its capabilities (step 3) and its services move to its app host (step 4), it:

  • takes remoteit.console with no capabilities as declaring ssh + person-accounts, person-certificates, ssh-exec (in parsedDeviceApp);
  • takes a service at host remoteit-console as at remoteit-app-remoteit-console (in appsHelper).

The removal step deletes the file and its two calls (and the two tests marked TEMPORARY). The console's host-key line depends on graphql filling DeviceApp.hostKey for the console (its console hook already has it).

Root consent is still asked for root apps only: graphql's consentRoot is about root, so a restricted app's capabilities are said, not consented to.

Tests

  • frontend: tsc --noEmit clean; vitest run 2140 passed (216 files); vite build OK; i18n:extract leaves the catalogs unchanged and i18n:check passes (new keys in en/de/es/ja; the console-only keys removed).
  • New/updated: AppTerminal.test (any ssh+certificate app; not for other protocols/capabilities, other services, an app naming another service; disabled found by host; consent names capabilities), sshHelper.test, appsHelper.test (capability words, icon, app host, serviceApp, console fallback), useDeviceApps.test (useServiceApp, offers: false), DeviceApps.test, DeviceAppPage.test (terminal, host key, capabilities, sessions, API labels), DeviceAppCatalogPage.test/AppsPage.test/AppPage.test/AppAddDialog.test/ProductPolicyApps.test (capabilities and consent), graphQLDeviceApps.test/graphQLAppCatalog.test/productPolicy.test (fields asked and parsed), ThisDevicePage.test (API-driven app settings).

🤖 Generated with Claude Code

…sole UI, no console detection

The portal had a part of its own for one app: FIRST_PARTY_APPS = {console} (ConsoleApp: its icon, state words,
ai_commands label, host key, Open terminal) and a console service found by type 28 at host remoteit-console
(sshHelper isConsoleService, in the services' rows, the connect panel and the device's name on this machine). An app
anyone ships could have none of it (presence-contract docs/self-contained-apps.md, the portal's row and
"Capabilities, as the platform keeps them"). Now every app is drawn from DeviceApp, CatalogApp and
CatalogAppRelease alone:

- protocol, capabilities, hostKey, sessions and sessionsOpen are read with an app; protocol and capabilities with
  a catalogue entry and each release (and a product's app, where the schema has them).
- An app whose service is ssh and that declares person-certificates (sshHelper opensTerminal) opens in web SSH,
  with the person's own account, a certificate and its host key checked: Open terminal in the Apps section and on
  its page, the terminal button in its device's services and the option in its connect panel (AppTerminal, which
  replaces ConsoleTerminal), the plain ssh command and its hint by name. Its service is the one its app names
  (DeviceApp.serviceId), or — disabled, naming none — the one at its app host (remoteit-app-<publisher>-<app>);
  a device's apps are read only for a service at an app host.
- The app's page says its state in the shared words, its settings in its release's labels and help (ai_commands
  included), the key its service presents where the device reports one, and the sessions it serves: how many, and
  who, as whom, by an AI and since when for those who manage it. Its icon comes from its protocol.
- What an app asks of remote.it beyond running is said in words beside Runs as root wherever it is offered — the
  catalogue, the device's catalogue (from its catalogue entry), the app and its releases, a product's apps — and is
  part of every root consent (the device's, the product's, Add's): "Keeps accounts for the people you share with",
  "Signs in people by remote.it certificate", "AI commands go through this app".
- This device's Advanced titles an app's on/off and its settings by the API's name and labels (the device by its
  UID), puts any app's settings under its row, and says "Not served" for an app that serves a service; only the
  device's own settings keep words here.

Until the console declares these (step 3) and its services move to its app host (step 4),
services/consoleUntilDeclared takes the console with no capabilities as declaring ssh, person-accounts,
person-certificates and ssh-exec, and its host remoteit-console as its app host, so it works as before. It is the
only place the portal names the console, and the removal step deletes it with its two calls. SCREENVIEW stays for
ScreenView's old install alone.

Needs graphql's DeviceApp.protocol/capabilities/hostKey/sessions/sessionsOpen and CatalogApp(Release)
.capabilities/protocol: an older graphql refuses these queries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@evanrbowers

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T15:36:55.068978Z f8be8bd Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: f8be8bdb29

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@evanrbowers

Copy link
Copy Markdown
Contributor Author

Superseded by #1340, merged into apps-contract-1 (3633673). It carries this PR's commit (f8be8bd) reworked onto remote.it apps contract 1: labelled choices, the owner's service port, services opened by protocol, sessions by id, AvailableApp's own capabilities, consents naming the target release's capabilities. The temporary console fallback is gone. Closing unmerged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant